package com.zhb.cloud.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.integration.redis.util.RedisLockRegistry;

/**
 * @ClassName: LockConfiguration
 * @Description: spring integration 提供的分布式锁配置
 * @author: zhb1316783262@163.com
 * @date: 2019年4月11日下午6:57:57
 */
@Configuration
public class LockConfiguration {
	@Autowired
	private RedisConnectionFactory redisConnectionFactory;
	@Bean
	public RedisLockRegistry redisLockRegistry() {
		return new RedisLockRegistry(redisConnectionFactory, "spring-cloud");
	}
}